import request from "@/router/axios";

export const getParentList = (current, size,params) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getChildList = (current, size, materialId, params) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com/list-details',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      materialId,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com/add',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com/update',
    method: 'post',
    data: row
  })
}


export const getUnitList = (current, size,params) => {
  return request({
    url: '/api/hg-public/unit/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
